import React from "react";
import { Navigate, NavLink } from "react-router-dom";

function Index(Com) {
  const token = localStorage.getItem("token");

  return () => {
    if (token) {
      return <Com></Com>;
    } else {
      return <Navigate to={"/login"}></Navigate>;
    }
  };
}

export default Index;
